package lab02.Test28;

import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * Created by Administrator on 2017/11/8.
 */
public class Test28 {
    public static void main(String[] args) {
        double radius = 0;
        while (true) {
            System.out.println("请输入圆的半径：");
            Scanner sc = new Scanner(System.in);
            try {
                radius = sc.nextDouble();
                area(radius);
            } catch (InputMismatchException e) {
                System.out.println("输入数据类型不匹配，请重新输入！");
            }
        }
    }

    public static void area(double radius) {
        double area = 3.14 * radius * radius;
        System.out.println("圆的面积是：" + area);
    }
}